//
//  ChatTitleView.swift
//  EyeVisionForPatients
//
//  Created by PMC on 2020/4/7.
//  Copyright © 2020 tao Tao. All rights reserved.
//

import UIKit

class ChatTitleView: UIView {

    @IBOutlet private weak var avatarView: UIImageView! {
        didSet {
            avatarView.contentMode = .scaleAspectFill
            avatarView.layer.cornerRadius = avatarView.height / 2
            avatarView.layer.masksToBounds = true
        }
    }
    
    @IBOutlet private weak var nameLabel: UILabel! {
        didSet {
            nameLabel.textColor = .textDark
            nameLabel.font = .medium_18
        }
    }
    
    func configure(with vm: AdvisoryDetailViewModel) {
        avatarView.kf.setImage(with: URL(string: vm.doctorAvatar),
                               placeholder: UIImage(named: "avatar_default"))
        nameLabel.text = vm.chatReceiveName
    }
}
